//
//  SShellRequest.h
//  TestForRequest
//
//  Created by admin on 2021/3/4.
//

#import "YTKBaseRequest.h"

NS_ASSUME_NONNULL_BEGIN
@class SShellRequest,ShellAPIResponse;

//ShellAPIResponse 里面包裹了返回值，状态，和data
typedef void(^ABCAPIResponseBlock)(__kindof ShellAPIResponse * _Nullable response);

//typedef NSString *_Nullable(^FinalRequestUrlBlock)(void);
//typedef id _Nullable(^FinalRequestArgumentBlock)(void);
//typedef YTKRequestMethod (^ _Nullable FinalRequestMethodBlock)(void);
//typedef YTKRequestQueryStringSerializationStyle (^ _Nullable FinalShellSerializationStyleBlock)(void);
//typedef NSDictionary *_Nullable(^ _Nullable FinalRequestHeaderFieldBlock)(void);
//typedef YTKRequestSerializerType (^ _Nullable FinalRequestSerializerTypBlock)(void);

typedef SShellRequest *_Nullable(^SShellStartBlock)(void);
typedef SShellRequest *_Nullable(^SShellRequestCompletionBlock)(ABCAPIResponseBlock);

@interface SShellRequest : YTKBaseRequest

//MARK: 用户可供调用的设置url等的block
@property(nonatomic, copy, readonly)SShellRequest *_Nullable(^requestUrlBlock)(NSString *);
@property(nonatomic, copy, readonly)SShellRequest *_Nullable(^requestArgumentBlock)(id);
@property(nonatomic, copy, readonly)SShellRequest *_Nullable(^requestMethodBlock)(YTKRequestMethod);
@property(nonatomic, copy, readonly)SShellRequest *_Nullable(^shellSerializationStyleBlock)(YTKRequestQueryStringSerializationStyle);
@property(nonatomic, copy, readonly)SShellRequest *_Nullable(^shellRequestHeaderFieldBlock)(NSDictionary*);
@property(nonatomic, copy, readonly)SShellRequest *_Nullable(^shellRequestSerializerTypBlock)(YTKRequestSerializerType);
@property(nonatomic, copy, readonly)SShellRequestCompletionBlock shellSuccessblock;
@property(nonatomic, copy, readonly)SShellRequestCompletionBlock shellFailureblock;

/// 开始请求的block，直接使用，并保证最后使用
@property(nonatomic, copy, readonly)SShellStartBlock startBlock;

// 自定义的成功失败的返回，
@property (nonatomic, copy, nullable) ABCAPIResponseBlock successResponseBlock;
@property (nonatomic, copy, nullable) ABCAPIResponseBlock failureResponseBlock;

@end

NS_ASSUME_NONNULL_END
